package com.example.gclove.mapper;

import com.example.gclove.pojo.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface UserMapper {
    List<User> findAllUser();

    void addUser(@Param("username") int username, @Param("password") String password, @Param("code") int code);

    boolean selectAllByUsername(@Param("username") int username);

    boolean selectAllByUsernameOrderByPassword(@Param("username") int username, @Param("password") String password);

    boolean selectByCode(@Param("code") int code);

    User addUserByCode(@Param("code") int code);

    User selectUserByUsernameOrderByPassword(@Param("username") int username, @Param("password") String password);

    User selectByLoveId(@Param("loveId") int loveId);

    void linkUser(@Param("id") int id, @Param("loveId") int loveId);

/*    void calSumById(@Param("id") int id);

    int BackSumById(@Param("id") int id);*/

}
